package com.ds.infrastructure.hyperspace.console.model.response.diagram;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.LongSummaryStatistics;
import java.util.Map;

/**
 * 堆叠柱状图
 * https://antv.alipay.com/zh-cn/g2/3.x/demo/column/column10.html
 *
 * @author: yaozhendong
 * @create: 2019-11-01 10:44
 **/
@Data
@NoArgsConstructor
public class Column10Chart {
    private Long xAxis;
    private Long yAxis;
    private String tag;

    public static Column10Chart toVO(Map.Entry<Long, LongSummaryStatistics> entry, String tag) {
        Column10Chart chart = new Column10Chart();
        chart.setXAxis(entry.getKey());
        chart.setYAxis(entry.getValue().getSum());
        chart.setTag(tag);
        return chart;
    }
}
